﻿using Sidewinder.Core.Interfaces.Entities;
using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core;
using Wolfpack.Core.Notification.Filters.Request;

namespace Wolfpack.Contrib.Deployment.NUnit
{
    public class NUnitDeploymentPublisherConfigurationDiscovery : PluginDiscoveryBase<NUnitDeploymentConfig, NUnitDeploymentPublisher>
    {
        protected override NUnitDeploymentConfig GetConfiguration()
        {
            return new NUnitDeploymentConfig
                       {
                           Args = "",
                           Command = "",
                           ConflictResolution = ConflictResolutionTypes.Overwrite,
                           DownloadFolder = @"_deploy\demo",
                           Enabled = true,
                           Feed = "http://www.myget.org/F/wolfpack/",
                           FriendlyId = "CHANGEME!",
                           NotificationMode = AlwaysPublishNotificationFilter.FilterName,
                           PackageId = "Wolfpack.Contrib.Demo",
                           ResultsFile = "",
                           TargetHealthCheckName = "The FriendlyId of the trigger NuGetRelease check",

                           Domain = "",
                           UserName = "",
                           Password = "",
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "NUnitDeploymentPublisher";
            entry.Description = "This publish reacts to a trigger message (usually from the NuGet check) and will " + 
                "download the updated NuGet package, unpack it and execute the nunit console runner over your test assemblies." + 
                "The nunit results are then parsed and sent as individual notifications.";
            entry.Tags.AddIfMissing(SpecialTags.PUBLISHER, "NUnit", "Deployment");
        }
    }
}